﻿

#region Using Statements

// System References
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading;

// XNA References
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

// Internal References
using Freeform.Framework;

#endregion


namespace Freeform.Framework.Geometry.Collision
{
    /// <summary>
    /// Collision Handlers are invoked when a collision is detected.
    /// </summary>
    public class CollisionHandler
    {

        #region Members

        /// <summary>
        /// Gets the collision properties that this handler works for.
        /// </summary>
        public virtual CollisionProperties CollisionProperties { get; private set; }


        /// <summary>
        /// Gets the entity that these collision properties refer to.
        /// </summary>
        public virtual Entity Entity { get; private set; }

        #endregion


        #region Init

        /// <summary>
        /// Creates a new collision handler.
        /// </summary>
        /// <param name="properties">The collision properties that this handler will work for.</param>
        public CollisionHandler(CollisionProperties properties)
        {
            CollisionProperties = properties;
            Entity = CollisionProperties.Entity;
        }

        #endregion


        #region Utility

        /// <summary>
        /// This function is called when the CollisionHandler's entity collides with another entity.
        /// </summary>
        /// <param name="otherEntity">The other entity with which our entity collided.</param>
        public virtual void HandleCollision(Entity otherEntity)
        { }

        #endregion

    }
}
